<?php
set_time_limit(0);
require_once("config.php");
$title = "Backlink Checker";
require_once("header.php");
?>
<table cellspacing="0" cellpadding="0" class="mytable">
  <tr>
    <td valign="top" colspan="2"></td>
  </tr>
  <tr>
    <td valign="top" align="middle" colspan="2">
        <form action="backlink_checker.php" method="get" name="pageform">
          <table width="100%" border="0">
            <tbody>
              <tr>
                <td valign="top" width="100%" height="91"><table height="76" width="100%">
                    <tbody>
                      <tr>
                        <td><table cellspacing="5" width="100%" border="0">
                            <tbody>
                              <tr>
                                <td width="184" height="28" class="fontv10pxb646464"><strong>Your domain: </strong></td>
                                <td width="239" height="28"><input size="33" value="<?php echo @$_REQUEST['domain']; ?>" name="domain" /></td>
                                <td height="28"><input name="submit" class="button" type="submit" value="Check!" /></td>
                              </tr>
                              <tr>
                                <td width="184" height="21">&nbsp;</td>
                                <td valign="top" class="style5" colspan="2" height="21">(eg.   webpromotioner.com)</td>
                              </tr>
							  <tr>
                                 <td colspan="3" height="21" class="normaltext">
								 <INPUT TYPE="checkbox" NAME="google" value="y" <?php if(isset($_REQUEST['google'])) echo "Checked"; ?>> Google 
								 <INPUT TYPE="checkbox" NAME="yahoo" value="y" <?php if(isset($_REQUEST['yahoo'])) echo "Checked"; ?>> Yahoo
								 <INPUT TYPE="checkbox" NAME="msn" value="y" <?php if(isset($_REQUEST['msn'])) echo "Checked"; ?>> MSN
								 </td>
                              </tr>
                            </tbody>
                        </table></td>
                      </tr>
                    </tbody>
                </table></td>
              </tr>
            </tbody>
          </table>
        </form>
      </td>
  </tr>
</table>
<?php
if (isset($_REQUEST['domain']) && isset($_REQUEST['google'])) {
	
	echo "<div id='div_google'>";
	echo "<h1>Google</h1>";
	require_once("query_google.php");
	echo "</div>";
}
if (isset($_REQUEST['domain']) && isset($_REQUEST['yahoo'])) {
	
	echo "<br><div id='div_yahoo'>";
	echo "<h1>Yahoo!</h1>";
	require_once("query_yahoo.php");
	echo "</div>";
}
if (isset($_REQUEST['domain']) && isset($_REQUEST['msn'])) {
	
	echo "<br><div id='div_msn'>";
	echo "<h1>MSN</h1>";
	require_once("query_msn.php");
	echo "</div>";
}
?>
<script>
var names = {"div_google":"Google","div_yahoo":"Yahoo!","div_msn":"MSN"};

var table = '<table width="99%" border="0" cellspacing="1" cellpadding="0"> <tr class="headingbar" height="26"> <td width="3%" align="center">&nbsp;</td>  <td width="67%" align="center"><strong>Link URL </strong></td> <td width="13%" align="center"><strong>Page Rank</strong></td> <td width="13%" align="center"><strong>IP Address </strong></td> <td width="4%" align="center"></td>      </tr><tr height="30"><td align="center" valign="middle" colspan="5">';


function getsubpanel(url, divs) {

	document.getElementById(divs).innerHTML = "<h1>"+names[divs]+"</h1>"+table+"<h3>Loading....</h3></td></tr></table>";

	xmlhttp_config = {"URL":url,"METHOD":"GET","ASYNCH":true};
	xmlHRH = new xmlHttpRequestHandler(xmlhttp_config);

	xmlHRH.setCallBackData('div',divs);
	//xmlHRH.setData("pageurls="+pageurls+"&keywords="+keywords+"&num="+n);

	xmlHRH.send(do_getsubpanel);
}

function do_getsubpanel(ob) {
	if(ob.responseText != '') {
		try{
			display_text(ob.callback_data['div'], ob.responseText);
		} catch(e) {
		}
	}
}

function display_text(divs, response_text) {
	document.getElementById(divs).innerHTML = "<h1>"+names[divs]+"</h1>"+response_text;
}
</script>
<?php
require_once("footer.php");
?>